Skip to content

refactor(sql-check): drop predicate_effect; keep read-only, bind and permission fixes - #1446

Open
anandgupta42 wants to merge 37 commits into
feat/analyst-harness-dab-2026-10from
feat/analyst-v10-probe
Open

anandgupta42 wants to merge 37 commits into
feat/analyst-harness-dab-2026-10from
feat/analyst-v10-probe

Conversation

@anandgupta42

@anandgupta42 anandgupta42 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Scope change. This PR originally added a sql_check predicate_effect mode. That mode is removed: every review round found another server-side definition (view bodies, cast functions, operators, catalog reads) that validating the SQL text could not see, it was already opt-in and off by default, and the agent never used it. What remains are the generic fixes that work surfaced, each with its own regression tests.

What changed (was, then now):

  • Permission prompts. A request with several patterns prompted on the first pattern that needed a prompt, so a deny rule matching a later pattern could be skipped. Now every pattern is evaluated before any prompt is published, and a deny on any pattern wins (permission/next.ts).
  • PostgreSQL bind parameters. Connector.execute dropped bind values on the regular and byte-limited query paths. Now they are forwarded on both.
  • Read-only execution on SQLite and DuckDB. readOnly was honoured only on PostgreSQL. Now SQLite runs with query_only (restoring the previous setting afterwards) and DuckDB runs inside a read-only transaction, refusing to start inside a caller's open transaction.
  • SQL tokenizer. CR-terminated comments, PostgreSQL backtick operators and PostgreSQL/DuckDB array syntax are tokenized correctly, which the shared read validation and statement splitting rely on.
  • sql_check errors. Validation failures return a readable message instead of a raw exception.

Base. Stacked on feat/analyst-harness-dab-2026-10 (#1441).

Behaviour deltas. sql_check keeps its existing checks (fanout, keys, grain, nulls, coverage) with no new parameters or config. SQLite and DuckDB reads issued with readOnly now refuse writes. A permission request with a later denied pattern is now denied instead of prompted.

How did you verify your code works?

  • packages/opencode: test/altimate/tools, test/config, test/permission, test/agent/analyst-data-explorer.test.ts and the query-deadline suite.
  • packages/drivers: full suite, including the PostgreSQL bind-forwarding and read-only tests.
  • bun run typecheck, the upstream marker check and git diff --check.
  • No reference to the removed mode remains in packages/.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code


Note

Medium Risk
Changes touch SQL execution guards, permission deny semantics, and read-only enforcement across three engines—behavior shifts (stricter reads, multi-pattern denies) are intentional but affect agent SQL tooling paths.

Overview
This PR tightens read-only warehouse execution and sql_check safety, plus fixes permission evaluation and PostgreSQL parameter forwarding.

Drivers. ExecuteOptions.readOnly now applies on SQLite (PRAGMA query_only, restored after each call) and DuckDB (helper runs BEGIN TRANSACTION READ ONLY then ROLLBACK, and refuses nested use inside an open transaction). DuckDB/SQLite drivers pass readOnly through to the local engine child. PostgreSQL again forwards bind parameters on both normal and byte-limited streaming query paths.

sql_check. Warehouse queries always use readOnly: true for SQLite, DuckDB, and Postgres. Read validation is stricter: broader denial of PostgreSQL side-effect pg_* / dblink / large-object calls, rejection of U&"..." function-name escapes, and tokenizer fixes so CR-ended comments, Postgres backticks, and Postgres/DuckDB ARRAY[...] do not hide writes. Invalid tool args return a clear sql_check invalid input message before connecting.

Permissions. PermissionNext.ask evaluates every pattern before showing a prompt; any matching deny wins instead of prompting on an earlier pattern only.

Reviewed by Cursor Bugbot for commit e8eafe4. Bugbot is set up for automated code reviews on this repo. Configure here.

anandgupta42 and others added 2 commits October 12, 2026 12:54
…removes

Analysts are told that a filter which removes nothing usually means the wrong
column, but there was no cheap way to verify it. `sql_check` gains an opt-in
`predicate_effect` check: given an explicit read-only population (`base_sql`,
a SELECT or a table reference) and one to eight boolean predicates, it runs a
single aggregate probe

    SELECT COUNT(*), COUNT(*) FILTER (WHERE p1), …, COUNT(*) FILTER (WHERE p1 AND …)

and reports rows kept and removed per predicate plus the combined count,
flagging `this predicate removes no rows at this population`. NULL counts as
not kept and the output says so; an empty population is reported as such.

- No rewriting of the caller's WHERE clause; predicates are validated as bare
  expressions through the existing read-only validator and the connection's
  dialect, and all supplied SQL goes through the `sql_execute` permission
  request before routing.
- Bounded: SQLite, DuckDB and Postgres only; a catalog row estimate above
  `max_rows_scanned` (default 5,000,000) for a bare table refuses with a
  suggestion to narrow the population; query timeouts return
  `skipped: timeout` instead of failing the caller.
- Analyst prompt: the existing "every clause must bite" sentence points at the
  check and says a vacuous filter is a reason to profile an alternative
  column, not to invent an exclusion.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…uts and all-row removal

Review follow-ups to the predicate-effect probe:

- When the catalog row estimate is unknown (views, SQLite without ANALYZE,
  unanalysed or partitioned Postgres tables, ambiguous relations) the output
  says `row_estimate: unknown — probe runs under the query timeout` instead
  of proceeding silently.
- Strict-schema fillers (`max_rows_scanned: 0`, blank predicates, empty
  `base_sql`) are treated as absent and produce the tool's own message, never
  a raw schema validation dump.
- A predicate that removes every row is flagged; counts over a `LIMIT`ed
  SELECT population say so.
- Postgres branch covered by tests (probe shape, `to_regclass`/`reltuples`
  guard, unknown-estimate path).
- The analyst prompt sentence ends with a period.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8d0af461-b17d-4881-9389-b2467fd34228

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T02:07:11.387326Z e8eafe4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
            20 sessions behind this PR            

  CODEX HELPERS (20) — no commits
  (unattributed usage) · 8m.......2,725,142 tokens
  (unattributed usage) · 5m.......1,714,750 tokens
  (unattributed usage) · 55s........335,922 tokens
  (unattributed usage) · 6m.......2,486,747 tokens
  (unattributed usage) · 5m.......1,796,759 tokens
  (unattributed usage) · 3m.........720,051 tokens
  (unattributed usage) · 2m.........838,914 tokens
  (unattributed usage) · 4m.......1,295,474 tokens
  (unattributed usage) · 2m.........842,488 tokens
  (unattributed usage) · 7m.......3,181,004 tokens
  (unattributed usage) · 1m.........429,520 tokens
  (unattributed usage) · 2m.........667,093 tokens
  (unattributed usage) · 1m.........273,391 tokens
  (unattributed usage) · 3m.......1,115,285 tokens
  (unattributed usage) · 2m.......1,010,597 tokens
  (unattributed usage) · 1m.........573,229 tokens
  (unattributed usage) · 7m.......3,258,401 tokens
  (unattributed usage) · 2m.........948,477 tokens
  (unattributed usage) · 2m.........992,777 tokens
  (unattributed usage) · 1m.........517,613 tokens
--------------------------------------------------
TOTAL unpriced...................25,723,634 tokens
  counted: 20 sessions
  cache served 95% of input tokens
  full receipts + session ids: section below
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -
full receipts (20 sessions)
session id scope turns time tokens in / out cached
codex bf2d1d70 no commits 1 8m 77k / 13k 97%
codex e64a7d03 no commits 1 5m 68k / 10k 96%
codex 713bc962 no commits 1 55s 23k / 1.5k 93%
codex 566ad48a no commits 1 6m 66k / 10k 97%
codex 7c07411a no commits 1 5m 77k / 12k 96%
codex ccf47896 no commits 1 3m 64k / 2.6k 91%
codex ceb2694a no commits 1 2m 46k / 5.2k 94%
codex 442e2da6 no commits 1 4m 74k / 10k 94%
codex c9f2f13a no commits 1 2m 40k / 4.3k 95%
codex f644a3ae no commits 1 7m 114k / 13k 96%
codex e591dbc3 no commits 1 1m 43k / 1.8k 90%
codex 9686d19b no commits 1 2m 58k / 5.5k 91%
codex 7a6f0c75 no commits 1 1m 29k / 1.8k 89%
codex bafa5b46 no commits 1 3m 55k / 6k 95%
codex 66d75c2e no commits 1 2m 76k / 3.7k 92%
codex 97fb3d8c no commits 1 1m 51k / 2.3k 91%
codex 3f4dee57 no commits 1 7m 109k / 14k 97%
codex 9ae87189 no commits 1 2m 87k / 4.2k 91%
codex 0377aa8e no commits 1 2m 61k / 4.8k 94%
codex 01792805 no commits 1 1m 41k / 2.9k 92%

codex · bf2d1d70

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 19:43:21 UTC · 8m 56s     
            (unattributed usage) 100%             
         cache served 97% of input tokens         

(unattributed usage)......2,725,142 tok  (0 calls)
exec.............................0 tok  (24 calls)
followup_task.....................0 tok  (3 calls)
send_message......................0 tok  (6 calls)
spawn_agent.......................0 tok  (3 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................2,725,142 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · e64a7d03

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 19:43:47 UTC · 5m 58s     
            (unattributed usage) 100%             
         cache served 96% of input tokens         

(unattributed usage)......1,714,750 tok  (0 calls)
exec.............................0 tok  (19 calls)
send_message......................0 tok  (9 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................1,714,750 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 713bc962

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
      Codex · Oct 12 2026 19:43:56 UTC · 55s      
            (unattributed usage) 100%             
         cache served 93% of input tokens         

(unattributed usage)........335,922 tok  (0 calls)
exec..............................0 tok  (6 calls)
send_message......................0 tok  (2 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................335,922 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 566ad48a

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 19:44:00 UTC · 6m 35s     
            (unattributed usage) 100%             
         cache served 97% of input tokens         

(unattributed usage)......2,486,747 tok  (0 calls)
exec.............................0 tok  (22 calls)
send_message.....................0 tok  (12 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................2,486,747 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 7c07411a

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 20:08:16 UTC · 5m 23s     
            (unattributed usage) 100%             
         cache served 96% of input tokens         

(unattributed usage)......1,796,759 tok  (0 calls)
exec.............................0 tok  (21 calls)
followup_task......................0 tok  (1 call)
send_message......................0 tok  (2 calls)
spawn_agent.......................0 tok  (2 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................1,796,759 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · ccf47896

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 20:08:39 UTC · 3m 35s     
            (unattributed usage) 100%             
         cache served 91% of input tokens         

(unattributed usage)........720,051 tok  (0 calls)
exec.............................0 tok  (12 calls)
send_message......................0 tok  (3 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................720,051 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · ceb2694a

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 20:09:01 UTC · 2m 24s     
            (unattributed usage) 100%             
         cache served 94% of input tokens         

(unattributed usage)........838,914 tok  (0 calls)
exec..............................0 tok  (9 calls)
send_message......................0 tok  (5 calls)
wait_agent.........................0 tok  (1 call)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................838,914 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 442e2da6

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 20:35:57 UTC · 4m 55s     
            (unattributed usage) 100%             
         cache served 94% of input tokens         

(unattributed usage)......1,295,474 tok  (0 calls)
exec.............................0 tok  (19 calls)
followup_task......................0 tok  (1 call)
send_message......................0 tok  (2 calls)
spawn_agent........................0 tok  (1 call)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................1,295,474 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · c9f2f13a

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 20:36:21 UTC · 2m 44s     
            (unattributed usage) 100%             
         cache served 95% of input tokens         

(unattributed usage)........842,488 tok  (0 calls)
exec.............................0 tok  (12 calls)
send_message......................0 tok  (5 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................842,488 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · f644a3ae

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 20:57:23 UTC · 7m 20s     
            (unattributed usage) 100%             
         cache served 96% of input tokens         

(unattributed usage)......3,181,004 tok  (0 calls)
exec.............................0 tok  (29 calls)
list_agents........................0 tok  (1 call)
send_message......................0 tok  (2 calls)
spawn_agent.......................0 tok  (3 calls)
wait_agent.........................0 tok  (1 call)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................3,181,004 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · e591dbc3

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 20:57:44 UTC · 1m 03s     
            (unattributed usage) 100%             
         cache served 90% of input tokens         

(unattributed usage)........429,520 tok  (0 calls)
exec..............................0 tok  (6 calls)
send_message......................0 tok  (3 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................429,520 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 9686d19b

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 20:58:30 UTC · 2m 34s     
            (unattributed usage) 100%             
         cache served 91% of input tokens         

(unattributed usage)........667,093 tok  (0 calls)
exec..............................0 tok  (8 calls)
send_message......................0 tok  (3 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................667,093 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 7a6f0c75

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 21:01:09 UTC · 1m 24s     
            (unattributed usage) 100%             
         cache served 89% of input tokens         

(unattributed usage)........273,391 tok  (0 calls)
exec..............................0 tok  (5 calls)
send_message.......................0 tok  (1 call)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................273,391 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · bafa5b46

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 21:21:23 UTC · 3m 24s     
            (unattributed usage) 100%             
         cache served 95% of input tokens         

(unattributed usage)......1,115,285 tok  (0 calls)
exec.............................0 tok  (15 calls)
followup_task......................0 tok  (1 call)
spawn_agent.......................0 tok  (2 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................1,115,285 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 66d75c2e

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 21:21:46 UTC · 2m 48s     
            (unattributed usage) 100%             
         cache served 92% of input tokens         

(unattributed usage)......1,010,597 tok  (0 calls)
exec.............................0 tok  (10 calls)
send_message......................0 tok  (4 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................1,010,597 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 97fb3d8c

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 21:21:51 UTC · 1m 10s     
            (unattributed usage) 100%             
         cache served 91% of input tokens         

(unattributed usage)........573,229 tok  (0 calls)
exec..............................0 tok  (7 calls)
send_message......................0 tok  (3 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................573,229 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 3f4dee57

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 23:08:06 UTC · 7m 41s     
            (unattributed usage) 100%             
         cache served 97% of input tokens         

(unattributed usage)......3,258,401 tok  (0 calls)
exec.............................0 tok  (29 calls)
list_agents........................0 tok  (1 call)
send_message......................0 tok  (4 calls)
spawn_agent.......................0 tok  (3 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL................................3,258,401 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 9ae87189

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 23:08:35 UTC · 2m 16s     
            (unattributed usage) 100%             
         cache served 91% of input tokens         

(unattributed usage)........948,477 tok  (0 calls)
exec..............................0 tok  (9 calls)
send_message......................0 tok  (4 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................948,477 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 0377aa8e

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 23:08:42 UTC · 2m 28s     
            (unattributed usage) 100%             
         cache served 94% of input tokens         

(unattributed usage)........992,777 tok  (0 calls)
exec.............................0 tok  (12 calls)
send_message......................0 tok  (4 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................992,777 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

codex · 01792805

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “# AGENTS.md instructions<INSTRUCTIONS># Resea…” 
    Codex · Oct 12 2026 23:13:35 UTC · 1m 56s     
            (unattributed usage) 100%             
         cache served 92% of input tokens         

(unattributed usage)........517,613 tok  (0 calls)
exec..............................0 tok  (7 calls)
send_message......................0 tok  (3 calls)

caveat: Codex request envelopes did not reconcile — request-level pricing disabled
--------------------------------------------------
TOTAL..................................517,613 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

Generated by aireceipts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52f0e5ed74

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
…nd keeps caller positions

Independent-review follow-ups:

- A bare-table population is wrapped under the table's own name, so a
  predicate copied from the caller's WHERE clause (`orders.kind = 'a'`)
  works; SELECT populations keep the `t` alias and the description says so.
- The limited-population note fires only for a top-level `LIMIT`,
  `FETCH FIRST … ROWS ONLY` or `TOP` on the population statement, not for a
  LIMIT inside a subquery.
- Blank predicate entries are reported as skipped at their original
  position, so predicate numbers match the caller's array.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25baadb1c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 25baadb. Configure here.

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
anandgupta42 and others added 2 commits October 12, 2026 14:10
… in predicates and populations

A review finding of the highest severity tier: on PostgreSQL connections
allowed to signal other backends, `pg_terminate_backend(pid)` or
`pg_cancel_backend(pid)` passes the read-only validator as a boolean
expression. The shared validator now blocks backend-signalling calls
(including escaped function names and CR-comment variants) before any
query runs; harmless literals, comments, column names and scalar
expressions remain accepted.

Tests: `rejects backend-signaling predicate <case> before query execution`
and the population variant (14 cases).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9b84ed5e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
…trol and dblink functions

Three review findings of the highest severity tier, each with red-first
tests:

- The probe executes with the connector's read-only mode, so a
  user-defined function that writes cannot be reached through a predicate.
- `pg_promote` and `pg_reload_conf` are denied in predicates and
  populations.
- `dblink_send_query`, `dblink_connect` and `dblink_connect_u` are denied in
  predicates and populations.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3fa390c878

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/opencode/src/altimate/tools/sql-check.ts
@kilo-code-bot

kilo-code-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (10 files)
  • packages/drivers/src/duckdb.ts
  • packages/drivers/src/local-engine-child-source.ts
  • packages/drivers/src/postgres.ts
  • packages/drivers/src/sqlite.ts
  • packages/drivers/src/types.ts
  • packages/drivers/test/postgres-readonly.test.ts
  • packages/opencode/src/altimate/tools/sql-check.ts
  • packages/opencode/src/altimate/tools/sql-tokenize.ts
  • packages/opencode/src/permission/next.ts
  • packages/opencode/test/altimate/tools/sql-check.test.ts
Previous Review Summaries (8 snapshots, latest commit 5df7cfa)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 5df7cfa)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 962 Operator catalog check matches by name only, refusing built-in operators when a same-named extension operator exists
Files Reviewed (10 files)
  • packages/core/src/v1/config/config.ts
  • packages/drivers/src/duckdb.ts
  • packages/drivers/src/local-engine-child-source.ts
  • packages/drivers/src/postgres.ts
  • packages/drivers/src/sqlite.ts
  • packages/drivers/src/types.ts
  • packages/opencode/src/altimate/prompts/analyst.txt
  • packages/opencode/src/altimate/tools/sql-check.ts - 1 issue
  • packages/opencode/src/altimate/tools/sql-tokenize.ts
  • packages/opencode/src/permission/next.ts

Fix these issues in Kilo Cloud

Previous review (commit 214e47e)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/src/altimate/tools/sql-check.ts
  • packages/opencode/test/altimate/tools/sql-check.test.ts

Previous review (commit 9ae7d77)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • packages/drivers/src/local-engine-child-source.ts
  • packages/opencode/src/altimate/tools/sql-check.ts
  • packages/opencode/test/altimate/sql-check-postgres.test.ts

Previous review (commit 5a69583)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 23 ls_\w*dir whitelists PostgreSQL filesystem-directory-listing functions (pg_ls_dir, pg_ls_logdir, pg_ls_waldir, pg_ls_archive_statusdir, pg_ls_tmpdir), leaking server filesystem paths and contradicting the stated "file functions denied" design.

SUGGESTION

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 25 lo_creat is redundant with lo_\w*; likewise indexes_size with \w*_size and get_userbyid with get_\w*.
Files Reviewed (2 files)
  • packages/opencode/src/altimate/tools/sql-check.ts - 2 issues
  • packages/opencode/test/altimate/sql-check-postgres.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit c9cfe17)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 190 lo_import_with_oid and lo_creat remain callable large-object write functions not matched by the denylist.
Files Reviewed (2 files)
  • packages/opencode/src/altimate/tools/sql-check.ts - 1 issue
  • packages/opencode/test/altimate/sql-check-postgres.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 2f824cf)

Status: 6 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 5
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 190 lo_from_bytea is missing from the large-object write denylist.
packages/opencode/src/altimate/tools/sql-check.ts 249 PostgreSQL parent-table estimates omit inherited child rows scanned by the probe.
packages/opencode/src/altimate/tools/sql-check.ts 286 SQLite partial-index statistics can understate a full table's scanned rows.
packages/opencode/src/altimate/tools/sql-check.ts 386 Timeout handling discards a local engine's in-memory or session-state loss warning.
packages/opencode/src/altimate/tools/sql-check.ts 224 A subquery or CTE LIMIT that bounds the population receives no caveat.

SUGGESTION

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 331 The unconditional readOnly: true makes the Postgres-only readOnly spread redundant.
Files Reviewed (2 files)
  • packages/opencode/src/altimate/tools/sql-check.ts - 6 issues
  • packages/opencode/test/altimate/sql-check-postgres.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 8e56751)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 249 PostgreSQL parent-table estimates omit inherited child rows scanned by the probe.
packages/opencode/src/altimate/tools/sql-check.ts 286 SQLite partial-index statistics can understate a full table's scanned rows.
packages/opencode/src/altimate/tools/sql-check.ts 385 Timeout handling discards a local engine's in-memory or session-state loss warning.
packages/opencode/src/altimate/tools/sql-check.ts 224 A subquery or CTE LIMIT that bounds the population receives no caveat.
Files Reviewed (8 files)
  • packages/drivers/src/duckdb.ts - 0 issues
  • packages/drivers/src/local-engine-child-source.ts - 0 issues
  • packages/drivers/src/sqlite.ts - 0 issues
  • packages/drivers/src/types.ts - 0 issues
  • packages/opencode/src/altimate/tools/sql-check.ts - 4 issues carried forward
  • packages/opencode/src/permission/next.ts - 0 issues
  • packages/opencode/test/altimate/sql-check-postgres.test.ts - 0 issues
  • packages/opencode/test/altimate/sql-check-predicate-effect.test.ts - 0 issues

Fix these issues in Kilo Cloud

The three prior critical findings are fixed at the current HEAD. No new inline findings were raised; existing comments were not duplicated. Review based on source and existing tests only; no code or tests were executed.

Previous review (commit 3fa390c)

Status: 7 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 3
WARNING 4
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 622 A permission prompt for the population can skip a later denied predicate pattern.
packages/opencode/src/altimate/tools/sql-check.ts 190 dblink() can execute remote writes outside the local read-only transaction.
packages/opencode/src/altimate/tools/sql-check.ts 316 pg_try_advisory_lock() can persist a session-level lock on a pooled connection.

WARNING

File Line Issue
packages/opencode/src/altimate/tools/sql-check.ts 249 PostgreSQL parent-table estimates omit inherited child rows scanned by the probe.
packages/opencode/src/altimate/tools/sql-check.ts 286 SQLite partial-index statistics can understate a full table's scanned rows.
packages/opencode/src/altimate/tools/sql-check.ts 385 Timeout handling discards a local engine's in-memory or session-state loss warning.
packages/opencode/src/altimate/tools/sql-check.ts 224 A subquery or CTE LIMIT that bounds the population receives no caveat.
Files Reviewed (6 files)
  • packages/opencode/src/altimate/prompts/analyst.txt - 0 issues
  • packages/opencode/src/altimate/tools/sql-check.ts - 7 issues
  • packages/opencode/src/altimate/tools/sql-tokenize.ts - 0 issues
  • packages/opencode/test/agent/analyst-data-explorer.test.ts - 0 issues
  • packages/opencode/test/altimate/sql-check-postgres.test.ts - 0 issues
  • packages/opencode/test/altimate/sql-check-predicate-effect.test.ts - 0 issues

Fix these issues in Kilo Cloud

Review based on source and existing tests only; no code or tests were executed. Earlier active review comments were not duplicated.


Reviewed by gemini-4-argon · Input: 539.9K · Output: 2.4K · Cached: 2.2M

Review guidance: REVIEW.md from base branch feat/analyst-harness-dab-2026-10

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
…_effect`

- Read-only classification: deny `pg_logical_emit_message` (its
  non-transactional form is written to WAL immediately and survives the
  rollback), bare `dblink` (the synchronous form runs its string argument on a
  remote connection outside the local read-only transaction) and every
  `pg_advisory_lock` / `pg_try_advisory_lock` / `pg_advisory_xact_lock` variant
  (session-level locks survive ROLLBACK and the session returns to the pool).
  Applies to the population and to every predicate; case-insensitive and
  schema-qualified spellings covered.
- Permission: `PermissionNext.ask` evaluated patterns in order and returned a
  prompt on the first `ask`, so a later pattern with an explicit `deny` would
  execute once the earlier one was approved. It now evaluates every pattern
  before publishing the approval request (`upstream_fix`).
- Local engines honour `readOnly`: SQLite runs the probe under a scoped
  `query_only` pragma restored afterwards; DuckDB runs it in a READ ONLY
  transaction that is rolled back, and refuses to start one while the caller
  has its own transaction open rather than aborting it. Previously the flag was
  silently ignored on both engines.
- Regression tests for each denied function family, for the deny-before-prompt
  ordering, and for SQLite/DuckDB read-only enforcement (hidden sequence writes
  in a view and in a predicate subquery, pragma restoration after failure, and
  the active-transaction refusal).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
anandgupta42 and others added 2 commits October 12, 2026 16:28
…te_effect

pg_advisory_unlock, pg_advisory_unlock_shared and pg_advisory_unlock_all release session-level locks held by the pooled connection, and a read-only rollback does not undo that. The denylist now covers every pg_advisory_* / pg_try_advisory_* function; regression cases added for the three unlock variants.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… the predicate_effect branch

Resolves the conflict in `packages/drivers/src/duckdb.ts` by keeping the shared-engine generation tracking from the base and this branch's `readOnly` flag on the engine call.
@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 962a10f7-5127-45e8-8bfa-0981b2640611)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fce7bad1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
…s in read-only `sql_check` sources

The denylist named individual dblink functions, so `dblink_open`/`dblink_fetch`/`dblink_close` (a remote data-modifying cursor whose close commits) passed, and it omitted `pg_wal_replay_pause`/`pg_wal_replay_resume`, which change recovery state on a standby and are not undone by rollback. The list now matches `dblink\w*` and `pg_wal_replay_\w*`. Tests: dblink cursor open/fetch/close (incl. a data-modifying CTE), and both WAL replay controls, each rejected before query execution in plain, schema-qualified and commented spellings.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 724a32c4-b274-4bd6-bad5-6b51aa6d6aca)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae69002dfd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts
…shaped calls

- The permission request now includes the probe's AND-combined predicate
  expression and the fixed catalog lookups (`pg_operator`, `pg_proc`, `pg_type`,
  `duckdb_functions()`), so rules scoped to a joint condition or to catalog
  reads apply before anything executes.
- Only reserved keywords that cannot name an unquoted function are skipped by
  call detection. `FILTER` and `OVER` count as clauses only right after a
  call's closing parenthesis. Unreserved names such as `range`, `rows`,
  `partition` and `within` are validated as calls, and `range` joins the pure
  allowlist so the catalog check still refuses a user-defined overload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@cursor

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: bc7e6804-df80-4a90-a307-f7f4dcdc5880)

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

1 similar comment
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9055a9102d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
…predicate_effect` runs

The permission request now mirrors execution: the PostgreSQL `pg_class` row estimate
for a bare table is included, and each catalog lookup (operators, functions, casts,
`duckdb_functions()`) is requested only when the SQL contains what that lookup checks.
The estimate statement is shared between the request and the probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
@cursor

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: fb21e109-3d2d-435a-a6b8-a0d437d89b9c)

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

2 similar comments
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b16bdb2c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@cursor

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 4924a910-1cc4-4dd8-b233-d8edd7ff0312)

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

1 similar comment
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5490811e8d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/altimate/tools/sql-check.ts Outdated
anandgupta42 and others added 2 commits October 14, 2026 17:31
…ect` pattern

Permission patterns for the probe are built by one helper. For a bare PostgreSQL
table it adds the row-estimate lookup followed by the probe, in the order the
executed statement contains them, so a rule spanning the catalog and a predicate
applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 15, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 8d1dbfe2-4c10-44a9-baa9-56286a935269)

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

2 similar comments
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

…eric fixes

The mode validated caller-supplied SQL by its text, and each review round found
another server-side definition that the text cannot reveal. It was opt-in, off by
default and unused, so it is removed with its config key, prompt sentence and
tests.

Kept, with regression tests: permission requests evaluate every pattern before
prompting, PostgreSQL forwards bind parameters on both query paths, SQLite and
DuckDB honour `readOnly`, tokenizer fixes for shared read validation, and readable
`sql_check` validation errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anandgupta42 anandgupta42 changed the title feat(analyst): sql_check predicate_effect reports what each filter removes refactor(sql-check): drop predicate_effect; keep read-only, bind and permission fixes Oct 15, 2026
@cursor

cursor Bot commented Oct 15, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: f6449f42-8c38-403a-a522-a5e037e4a859)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant